package com.cnc.ssm.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import java.io.Serializable;

/**
 * @author Hibernate CodeGenerator
 */
public class PwRole implements Serializable {
    
    // 普通客户角色
    public static final String COMMON_ROLE_CODE = "customer";

    /**
     * identifier field
     */
    private String roleCode;

    /**
     * nullable persistent field
     */
    private String roleName;

    /**
     * nullable persistent field
     */
    private String roleDesc;

    /**
     * full constructor
     */
    public PwRole(java.lang.String roleCode, java.lang.String roleName, java.lang.String roleDesc) {
        this.roleCode = roleCode;
        this.roleName = roleName;
        this.roleDesc = roleDesc;
    }

    /**
     * default constructor
     */
    public PwRole() {
    }

    /**
     * minimal constructor
     */
    public PwRole(java.lang.String roleCode) {
        this.roleCode = roleCode;
    }

    public java.lang.String getRoleCode() {
        return this.roleCode;
    }

    public void setRoleCode(java.lang.String roleCode) {
        this.roleCode = roleCode;
    }

    public java.lang.String getRoleName() {
        return this.roleName;
    }

    public void setRoleName(java.lang.String roleName) {
        this.roleName = roleName;
    }

    public java.lang.String getRoleDesc() {
        return this.roleDesc;
    }

    public void setRoleDesc(java.lang.String roleDesc) {
        this.roleDesc = roleDesc;
    }

    public String toString() {
        return new ToStringBuilder(this)
                .append("roleCode", getRoleCode())
                .toString();
    }

    public boolean equals(Object other) {
        if (!(other instanceof PwRole)) return false;
        PwRole castOther = (PwRole) other;
        return new EqualsBuilder()
                .append(this.getRoleCode(), castOther.getRoleCode())
                .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
                .append(getRoleCode())
                .toHashCode();
    }

}
